/*
 * Copyright 2002-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.beans.factory;

/**
 * 允许 bean 知道 bean {@link ClassLoader class loader} 的回调；即当前 bean 工厂用来加载 bean 类的类加载器。
 *
 * <p>这主要是为了由框架类实现，尽管它们可能是从共享类加载器加载的，但它们必须按名称获取应用程序类。
 *
 * <p>有关所有 bean 生命周期方法的列表，请参阅 {@link BeanFactory BeanFactory javadocs}。
 *
 * @author Juergen Hoeller
 * @author Chris Beams
 * @since 2.0
 * @see BeanNameAware
 * @see BeanFactoryAware
 * @see InitializingBean
 */
public interface BeanClassLoaderAware extends Aware {

	/**
	 * 将 bean {@link ClassLoader class loader} 提供给 bean 实例的回调。
	 * <p>调用 <i>after<i> 普通 bean 属性的填充，但 <i>before<i> 初始化回调，
	 * 例如 {@link InitializingBean InitializingBean's}
	 * {@link InitializingBean#afterPropertiesSet()} 方法或自定义初始化方法。
	 * @param classLoader the owning class loader
	 */
	void setBeanClassLoader(ClassLoader classLoader);

}
